package com.jiangdg.demo

import android.content.Intent
import android.os.Bundle
import android.view.WindowManager
import android.widget.Button
import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity

class LoginActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)

        setContentView(R.layout.activity_login)

        val username: EditText = findViewById(R.id.username)
        val password: EditText = findViewById(R.id.password)
        val loginButton: TextView = findViewById(R.id.login)

        loginButton.setOnClickListener {
            val intent = Intent(this, MainActivity::class.java)
            startActivity(intent)
            finish()
//            val user = username.text.toString()
//            val pass = password.text.toString()
//
//            if (user.isNotEmpty() && pass.isNotEmpty()) {
//                // Perform login logic here
//                // For demonstration, we'll just show a toast and proceed to the main activity
//                Toast.makeText(this, "Login Successful", Toast.LENGTH_SHORT).show()
//                val intent = Intent(this, MainActivity::class.java)
//                startActivity(intent)
//                finish()
//            } else {
//                Toast.makeText(this, "Please enter username and password", Toast.LENGTH_SHORT).show()
//            }
        }
    }
}
